import rxAjax from '@/assets/js/ajax.js';

//应用接口授权管理表 api接口
export const SysAuthManagerApi = {};

SysAuthManagerApi.baseUrl= '/api-system/system/core/sysAuthManager';
SysAuthManagerApi.exportUrl= SysAuthManagerApi.baseUrl + '/listExport';

//查询列表
SysAuthManagerApi.query=function (parameter) {
  var url= SysAuthManagerApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

SysAuthManagerApi.getAllList=function(){
  var url=SysAuthManagerApi.baseUrl + '/getAllList';
  return rxAjax.postJson(url);
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
SysAuthManagerApi.get =function(pkId) {
  var url= SysAuthManagerApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
SysAuthManagerApi.save =function(parameter) {
  var url= SysAuthManagerApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
SysAuthManagerApi.del =function(parameter) {
  var url= SysAuthManagerApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//生成密钥
SysAuthManagerApi.genSecret =function(){
  var url=SysAuthManagerApi.baseUrl + '/genSecret';
  return rxAjax.get(url);
}

export  default SysAuthManagerApi;

